package com.heima.media.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.media.entity.WmUser;
import com.heima.media.service.IWmUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/user")
public class WmUserController {

    @Autowired
    private IWmUserService wmUserService;

    //保存自媒体用户
    @PostMapping
    public ResponseResult saveWmUser(@RequestBody WmUser user) {
        return wmUserService.saveWmUser(user);
    }

    //修改自媒体用户
    @PutMapping
    public ResponseResult updateWmUser(@RequestBody WmUser user) {
        wmUserService.updateById(user);
        return ResponseResult.okResult();
    }
}